package com.itheima.dao;

import com.itheima.domain.Account;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @description:
 * @author: 付益民
 * @create: 2020-09-25-20:01
 */
public interface AccountDao {
    @Insert("insert into account values(null,#{name},#{money})")
    int saveAccount(Account account);

    @Delete("delete from account where id=#{id}")
    int deleteAccount(String id);

    @Update("update account set name=#{name},money=#{money} where id=#{id}")
    int updateAccount(Account account);

    @Select("select * from account")
    List<Account> findAll();

    @Select("select * from account where id=#{id}")
    Account findById(String id);

}
